package com.yksj.healthtalk.utils;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;

import com.yksj.healthtalk.comm.GuidePagerFragmentActivity;

/**
 * 动画 工具类
 * @author jack_tang
 *
 */
public class AnimationUtils {

	/**
	 * 旋转动画 
	 * Button view, 旋转的view
	 * float fromDegrees,旋转开始位置 
	 * float toDegrees 旋转到什么位置
	 */
	public static void startRotateAnimation(View view,float fromDegrees, float toDegrees){
	Animation mTranslate = new RotateAnimation(fromDegrees, toDegrees,Animation.RELATIVE_TO_SELF, 0.5f,
				Animation.RELATIVE_TO_SELF, 0.5f);
		mTranslate.setInterpolator(new LinearInterpolator());
		mTranslate.setFillAfter(true);
		mTranslate.setDuration(500);
		view.startAnimation(mTranslate);
		mTranslate=null;
	}
	/**
	 * 引导页
	 * @param activity
	 * @param type
	 */
	public static void startGuiPager(Context context,String className){
		Intent intent=new Intent(context, GuidePagerFragmentActivity.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.putExtra("className",className);
		context.startActivity(intent);
	}
	
}
